package pe.com.cineplanet.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;
import org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver;

import pe.com.cineplanet.service.Service;

public class RubroController extends MultiActionController {

	Service service;
	

	public RubroController()
    {
        ParameterMethodNameResolver resolver = new ParameterMethodNameResolver();
        resolver.setParamName("method");
        resolver.setDefaultMethodName("buscar");
        setMethodNameResolver(resolver);
    }
	
	public ModelAndView buscar(HttpServletRequest request, HttpServletResponse response)
    throws Exception {
		System.out.println("[Buscar]");
		ModelAndView model = new ModelAndView("rubro/buscar");
		return model;
	} 

	public ModelAndView filtro(HttpServletRequest request, HttpServletResponse response)
    throws Exception {
		System.out.println("[Filtrar]");
		ModelAndView model = new ModelAndView("rubro/filtrar");
		return model;
	}
	
	

	public ModelAndView nuevo(HttpServletRequest request, HttpServletResponse response)
    throws Exception {
		
		ModelAndView model = new ModelAndView("rubro/nuevo");
		return model;
	} 
	
	public ModelAndView editar(HttpServletRequest request, HttpServletResponse response)
    throws Exception {
		
		ModelAndView model = new ModelAndView("rubro/editar");
		return model;
	} 
	
	public void setService(Service service) {
		this.service = service;
	}
	
	public Service getService() {
		return service;
	}
	

}
